??Broodstock??
34
Broodstock
3452
Fallback
152
Mortality/Surplus
552
Released from Broodstock
66
Released From Broodstock
222
Released From Broodstock & Fellback
2
Spawned and then Released from Broodstock
2
Spawning Grounds
48601
#counts per year by sex and origin#pdf("year counts by sex and origin.pdf")ggplot(data=pedf,aes(Year.off,fill=Origin_ped.off)) +geom_bar() +facet_wrap(~Sex_Final.off) +scale_fill_manual(values=c("darkseagreen","steelblue"))
Don't know how to automatically pick scale for object of type <difftime>.
Defaulting to continuous.
#dev.off()
Annual length (POH) distribution, by sex
#pdf("POH by year and sex.pdf")ggplot(data=pedf,aes(y=as.factor(Year.off),x=POH.off,fill=Sex_Final.off)) +geom_violin(draw_quantiles = .5) +scale_fill_manual(values=c("darkseagreen","steelblue"))
Annual length (POH) distribution by origin, original
#pdf("POH by year and origin.pdf")ggplot(data=pedf,aes(y=as.factor(Year.off),x=POH.off,fill=Origin.off)) +geom_violin(draw_quantiles = .5) +scale_fill_manual(values=c("darkseagreen","steelblue"))
Annual length (POH) distribution by origin, pedigree corrected
#pdf("POH by year and origin.pdf")ggplot(data=pedf,aes(y=as.factor(Year.off),x=POH.off,fill=Origin_ped.off)) +geom_violin(draw_quantiles = .5) +scale_fill_manual(values=c("darkseagreen","steelblue"))
Dot plot of reproductive success (RS = adult offspring number) by location
# RS by year, origin, sex, and location#pdf("RS by year and origin and final location.pdf")ggplot(data=subset(pedf),aes(y=as.factor(Year.off),x=noff.off,color=Origin_ped.off)) +geom_jitter() +scale_color_manual(values=c("darkseagreen","steelblue")) +facet_wrap(~Final_Status_ped.off,scales="free")
Try to make a figure illustrating how origin and location change over time
d =subset(pedf,Year.off <=2018)nrow(d)
[1] 48648
d =subset(d,!is.na(sire) &!is.na(dam))nrow(d)
[1] 33497
# convert day of year to integer, and substract 100 -- is now days after April 10d$Dayofyear.off =as.integer(d$Dayofyear.off-100)d$Dayofyear.dam =as.integer(d$Dayofyear.dam-100)d$Dayofyear.sire =as.integer(d$Dayofyear.sire-100)d$Dayofyear.off =ifelse(d$Final_Status_ped.off=="Broodstock",-1*d$Dayofyear.off,d$Dayofyear.off)d$Dayofyear.dam =ifelse(d$Final_Status_ped.dam=="Broodstock",-1*d$Dayofyear.dam,d$Dayofyear.dam)d$Dayofyear.sire =ifelse(d$Final_Status_ped.sire=="Broodstock",-1*d$Dayofyear.sire,d$Dayofyear.sire)nudge = .05d$Year.off =ifelse(d$Origin_ped.off=="Hatchery",d$Year.off + nudge,d$Year.off-nudge)d$Year.dam =ifelse(d$Origin_ped.dam=="Hatchery",d$Year.dam + nudge,d$Year.dam-nudge)d$Year.sire =ifelse(d$Origin_ped.sire=="Hatchery",d$Year.sire + nudge,d$Year.sire-nudge)plot =ggplot(data=d,aes(y=Year.off,x=Dayofyear.off,color=Origin_ped.off)) +geom_segment(xend = d$Dayofyear.sire,yend = d$Year.sire,color="olivedrab",alpha=.1,linewidth=.05) +ylab("Year") +geom_segment(xend = d$Dayofyear.dam,yend = d$Year.dam,color="olivedrab",alpha=.1,linewidth=.05) +geom_point(alpha=.2,size=1,pch=16) +ylab("Year") +xlab("Day of year") +scale_color_manual(values=c("indianred","lightsteelblue"))plot
Effects of number of wild (or hatchery) grandparents on RRS
### note - this file was created using the field-only origin - not ped-correctedanc =read.csv("/Users/mike.ford/Documents/MikeFord/WenSpChkProp/FRANZWensp_analysis/Ancestor_origins_1.22.25.csv",stringsAsFactors = F)pedf =merge(pedf,anc,by="id",all.x=T)#write.csv(pedf,"pedf_with_anc.csv",row.names = F)
Identify individuals with varying number of hatchery or wild grandparents or other ancestors, for potential WGS analysis.
In the file below, the wild_parents_and_grandparents.csv file contains fish with two wild parents and four wild grandparents. They can have hatchery ancestry for generations deeper than grandparents. The file hat_parents_and_grandparents.csv is the same, but for hatchery parents and grandparents.
The files wild_lineages.csv and hatchery_lineages.csv contain fish with only wild or only hatchery ancestry. Note that ancestry information is incomplete, however.
Make some files for Joanna for potential WGS selection: